#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
const char* p = "./";
const int proccess_id = 0x11223344;
struct Mymsgbuf
{
    long msgtype;
    char text[1024];
};
int getkey()
{
    key_t key = ftok(p, proccess_id);
    if(key < 0)
    {
        printf("ftok error , %s\n", strerror(errno));
        exit(0);
    }
    return key;
}